import React,{Component} from 'react'
import {DrawerNavigator,TabNavigator,StackNavigator} from 'react-navigation'
// import MainScreen from './pages/MainScreen'
import LoginScreen from './pages/LoginScreen'
import HomeScreen from './pages/HomeScreen'
import CommunicationScreen from './pages/CommunicationScreen'
import FindScreen from './pages/FindScreen'
import UserScreen from './pages/UserScreen'

const MainTabs = TabNavigator(
    {
        Home:{
            screen: HomeScreen
        },
        Communication:{
            screen: CommunicationScreen
        },
        Find:{
            screen: FindScreen
        },
        User:{
            screen: UserScreen
        }
    },
    {//定义配置
        initialRouteName: 'Home',     //设置初始路由为Home
        tabBarPosition: 'bottom',             //设置标签栏位置
        animationEnabled: true,               //开启标签页切换动画
        swipeEnabled: true,                   //允许标签页之间滑动切换
    }
)

const RootStack = StackNavigator(
    {//定义路由
      Main: {                       //定义Home对应HomeScreen组件
        screen: MainTabs,
      },
      Login: {
        screen: LoginScreen,
      },
    },
    {//定义配置
      initialRouteName: 'Main',     //设置初始路由为Home
    }
);


export default class App extends Component{
    render() {
        return <RootStack />
    }
}